package com.mymoney;

import android.app.Activity;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class AddTxGUI extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add_tx);
        
        
        
    }
    
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
    	super.onWindowFocusChanged(hasFocus);
    	
    	ImageView imgAddTrans = (ImageView) findViewById(R.id.add_trans);
        LinearLayout top = (LinearLayout) findViewById(R.id.top);
        
        //get screen size
        Display display = getWindowManager().getDefaultDisplay();
        
        //set image add_trans layout
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        
        lp.leftMargin = (display.getWidth()-imgAddTrans.getWidth())/2;
        lp.topMargin = -(top.getBackground().getBounds().height() - imgAddTrans.getHeight())/2;
        imgAddTrans.setLayoutParams(lp);
    }
}
